LinearGauge for ASP.NET Web Forms
Setting the Minimum and Maximum Values
Task-Based Help > Setting the Minimum and Maximum Values

You can use the C1Gauge.Min and C1Gauge.Max properties to set a numeric range that the gauge would be limited to. You can customize the C1Gauge.Min and C1Gauge.Max values at design time, in XAML, and in code.

Note: When setting the C1Gauge.Min and C1Gauge.Max properties, the C1Gauge.Min should be smaller than the C1Gauge.Max. Also be sure to set the C1Gauge.Value property to a number within the C1Gauge.Min and C1Gauge.Max range (in the example below, the C1Gauge.Value is set to 0, which falls within the range set below).

At Design Time

To set the C1Gauge.Min and C1Gauge.Max for the C1LinearGauge at run time, complete the following steps:

  1. Click the C1LinearGauge control once to select it.
  2. Navigate to the Properties window, and enter a number, for example 50, next to the C1Gauge.Max property.
  3. In the Properties window, enter a number, for example -50, next to the C1Gauge.Min property.

This will set C1Gauge.Min and C1Gauge.Max values.

In XAML

To set the C1LinearGauge control's C1Gauge.Min and C1Gauge.Max in XAML add Maximum="50" Minimum="-50" to the <cc1:C1LinearGauge> tag so that it appears similar to the following:

To write code in Source View

<cc1:C1LinearGauge Name="C1LinearGauge1" Maximum="50" Minimum="-50">

In Code

To set the C1LinearGauge control's C1Gauge.Min and C1Gauge.Max add the following code to your project:

To write the code in Visual Basic:

Visual Basic
Copy Code
C1LinearGauge1.Minimum = -50
C1LinearGauge1.Maximum = 50

To write the code in C:

C#
Copy Code
c1LinearGauge1.Minimum = -50;
c1LinearGauge1.Maximum = 50;

 Run your project and observe:

The gauge will be limited to the selected range at run time.